$(function (){
	WindowHeight(0);setTimeout("WindowHeight(-1)",500);

});


// 检测表单
function CheckForm(){
	if ($id('dataID').value > 0){
		if ($id('theme').value==""){alert("产品类型名称 不能为空！");$id('theme').focus();return false;}
	}else{
		if ($id('themeMore').value==""){alert("产品类型名称 不能为空！");$id('themeMore').focus();return false;}
	}
	if ($id('classID').value==""){alert("请选择 产品模块！");$id('classID').focus();return false;}
	if ($id('companyID').value==""){alert("请选择 上级渠道商！");$id('companyID').focus();return false;}
	return true
}


function CheckCompanyID(){
	var val_ = $id("classID").value;
	var item_ = 'null';
	switch (val_){
		case '1':		item_ = 'host';		break;
		case '2':		item_ = 'vpsApi';	break;
		case '3':		item_ = 'serv';		break;
		case '5':		item_ = 'dialing';	break;
		case '6':		item_ = 'ssl';		break;
		case '7':		item_ = 'idcServ';	break;
	}

	for (i=0; i<document.getElementById('companyID').options.length; i++){
		var obj_ = document.getElementById('companyID').options[i];
		if ( obj_.title.indexOf('['+ item_ +']') != -1 ){
			obj_.style.display = "";
		}else if (obj_.value != ""){
			obj_.style.display = "none";
		}
	}

}


// 批量添加到【IDC商品类别】
function MoreMoveTo(){
	if ($id('moreMoveTo').value==""){ return false; }
	var selNum = 0;
	for (var i=0;i<$name("selDataID[]").length;i++){
		if ($name("selDataID[]")[i].checked){
			selNum ++;
		}
	}
	if (selNum==0){
		alert('请先选择要移动的记录.');$id('moreMoveTo').value="";return false;
	}
	selOptionText = $id('moreMoveTo').options[$id('moreMoveTo').selectedIndex].text;
	$id('moreMoveToCN').value = selOptionText;
	if (confirm("选中"+ selNum +"条记录，你确定要批量添加到IDC商品类别【"+ selOptionText +"】？")==true){
		$id('listForm').action="vpsType_deal.php?mudi=moreAddIpt";
		$id('listForm').submit();
	}else{
		$id('moreMoveTo').value="";
	}
	
}
